import axios from '@/request/http'
import { commonOutDTO, pageCommonInputDTO, pageCommonOutDTO } from '@/api/common.d'
import {
  GdajListQueryParam,
  GdajListQueryResult,
  DdcajListQueryParam,
  DdcajListQueryResult,
  YdcajListQueryParam,
  YdcajListQueryResult,
  DhCreateInputDTO,
  DhCreateOutputDTO,
  SjbExportInputDTO,
  SjbExportOutputDTO,
  AjxxCheckInputDTO,
  AjxxCheckOutputDTO,
  AjxxSaveInputDTO,
  AjxxSaveOutputDTO,
  TjdwInputDTO,
  TjdwOutputDTO,
  TjbmInputDTO,
  TjbmOutputDTO,
  TjryInputDTO,
  TjryOutputDTO,
  CctjOutputDTO,
  GdqktjOutputDTO,
  NdgdsjtjOutputDTO,
  TgspjlInputDTO,
  TgspjlListOutputDTO,
  TgspjlOutputDTO,
} from './dagl-dto'

export default class daglService {
  /**
   * 获取归档案卷列表
   */
  static queryGdajList(
    data: pageCommonInputDTO<GdajListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<GdajListQueryResult[]>>> {
    return axios.post('/api/dagl/queryGdajList', data)
  }
  /**
   * 获取待导出案卷列表
   */
  static queryDdcajList(
    data: pageCommonInputDTO<DdcajListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<DdcajListQueryResult[]>>> {
    return axios.post('/api/dagl/queryDdcajList', data)
  }
  /**
   * 获取已导出案卷列表
   */
  static queryYdcajList(
    data: pageCommonInputDTO<YdcajListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<YdcajListQueryResult[]>>> {
    return axios.post('/api/dagl/queryYdcajList', data)
  }
  /**
   * 生成档号
   */
  static createDh(data: DhCreateInputDTO): Promise<commonOutDTO<DhCreateOutputDTO[]>> {
    return axios.post('/api/dagl/createDh', data)
  }
  /**
   * 导出数据包
   */
  static exportSjb(data: SjbExportInputDTO): Promise<commonOutDTO<SjbExportOutputDTO>> {
    return axios.post('/api/dagl/exportSjb', data, { responseType: 'blob' })
  }
  /**
   * 导出档案数据包
   */
  static dcDaxxsjb(data: any): Promise<commonOutDTO<any>> {
    return axios.post('/api/dagl/dcDaxxsjb', data)
  }
  /**
   * 校验案卷信息（案卷检测）
   */
  static checkAjxx(data: AjxxCheckInputDTO): Promise<commonOutDTO<AjxxCheckOutputDTO>> {
    return axios.post('/api/dagl/checkAjxx', data)
  }
  /**
   * 保存案卷信息
   */
  static saveAjxx(data: AjxxSaveInputDTO): Promise<commonOutDTO<AjxxSaveOutputDTO>> {
    return axios.post('/api/dagl/saveAjxx', data)
  }
  /**
   * 查询单位统计数据
   */
  static queryTjdwdasl(data: TjdwInputDTO): Promise<commonOutDTO<TjdwOutputDTO[]>> {
    return axios.post('/api/dagl/queryTjdwdasl', data)
  }
  /**
   * 查询部门统计数据
   */
  static queryTjbmdasl(data: TjbmInputDTO): Promise<commonOutDTO<TjbmOutputDTO[]>> {
    return axios.post('/api/dagl/queryTjbmdasl', data)
  }
  /**
   * 查询部门统计数据
   */
  static queryTjrydasl(data: TjryInputDTO): Promise<commonOutDTO<TjryOutputDTO[]>> {
    return axios.post('/api/dagl/queryTjrydasl', data)
  }
  /**
   * 查询部门统计数据
   */
  static queryTjdwmxdasl(data: TjbmInputDTO): Promise<commonOutDTO<TjdwOutputDTO>> {
    return axios.post('/api/dagl/queryTjdwmxdasl', data)
  }
  /**
   * 查询储存统计
   */
  static queryCctj(): Promise<commonOutDTO<CctjOutputDTO>> {
    return axios.post('/api/dagl/queryCctj', {})
  }

  // 档案统计-归档情况统计
  static queryGdqktj(data: any): Promise<commonOutDTO<GdqktjOutputDTO>> {
    return axios.post('/api/dagl/queryGdqktj', data)
  }

  // 查询年度归档案件归档趋势
  static queryNdgdsjtj(data: any): Promise<commonOutDTO<NdgdsjtjOutputDTO[]>> {
    return axios.post('/api/gdgl/queryNdgdsjtj', data)
  }

  /**
   * 获取退改审批记录审核流程
   */
  static queryJyshlc(data: TgspjlInputDTO): Promise<commonOutDTO<TgspjlOutputDTO>> {
    return axios.post('/api/gdgl/queryTgspjlList', data)
  }
}
